home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / OS / FWGraphx / Include / FWInk.h < prev    next >
Encoding:
Text File  |  1994-04-21  |  3.4 KB  |  127 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWInk.h
  4. //    Release Version:    $ 1.0d1 $
  5. //
  6. //    Creation Date:        3/28/94
  7. //
  8. //    Copyright:    © 1993, 1994 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef FWINK_H
  13. #define FWINK_H
  14.  
  15. #ifndef FWGROBJ_H
  16. #include "FWGrObj.h"
  17. #endif
  18.  
  19. #ifndef FWGCONST_H
  20. #include "FWGConst.h"
  21. #endif
  22.  
  23. #ifndef FWCOLOR_H
  24. #include "FWColor.h"
  25. #endif
  26.  
  27. // ----- Macintosh Includes -----
  28.  
  29. #if defined(FW_BUILD_MAC) && !defined(__QUICKDRAW__)
  30. #include <QuickDraw.h>
  31. #endif
  32.  
  33. //========================================================================================
  34. //    •• Forward Class Declarations
  35. //========================================================================================
  36.  
  37. class FW_CGraphicContext;
  38. class FW_CInkRep;
  39.  
  40. //========================================================================================
  41. //    •• CLASS FW_CInk
  42. //========================================================================================
  43.  
  44. class FW_CInk : public FW_CGraphicObjectPtr
  45. {
  46. public:
  47.     FW_CInk();
  48.     FW_CInk(const FW_CColor& foreColor, 
  49.             const FW_CColor& backColor = FW_kRGBWhite, 
  50.             FW_TransferMode tranferMode = FW_kCopy);
  51.     FW_CInk(const FW_CInk& other);
  52.     FW_CInk(FW_CInkRep* rep);
  53.     
  54.     FW_CInk& operator=(const FW_CInk& other);
  55.     FW_CInk& operator=(FW_CInkRep* other);
  56.         
  57.     FW_CInkRep* operator->() const;
  58. };
  59.  
  60. //----------------------------------------------------------------------------------------
  61. //    • FW_CInk::operator->
  62. //----------------------------------------------------------------------------------------
  63. inline FW_CInkRep* FW_CInk::operator->() const
  64. {
  65.     return (FW_CInkRep*)GetRep();
  66. }
  67.  
  68. //==============================================================================
  69. //    •• class FW_CInkRep
  70. //==============================================================================
  71.  
  72. class FW_CInkRep : public FW_CGraphicObjectRep
  73. {
  74.     friend class FW_CInk;
  75.  
  76. //------------------------------------------------------------------------------
  77. //    • Inherited API
  78. //
  79. public:
  80.     virtual void            Flatten(FW_CWritableStream& stream);
  81.     virtual void            Unflatten(FW_CReadableStream& stream);
  82.     
  83. //------------------------------------------------------------------------------
  84. //    • New API
  85. //
  86. public:
  87.     void            SetForeColor(const FW_CColor& foreColor);
  88.     void            GetForeColor(FW_CColor& foreColor) const
  89.                         {foreColor = fForeColor;}
  90.     
  91.     void            SetBackColor(const FW_CColor& backColor);
  92.     void            GetBackColor(FW_CColor& backColor) const
  93.                         {backColor = fForeColor;}
  94.     
  95.     void            SetTransferMode(FW_TransferMode transferMode);
  96.     FW_TransferMode    GetTransferMode() const
  97.                     {return fTransferMode;}
  98.  
  99.     FW_CInk            Copy() const;
  100.     
  101. //------------------------------------------------------------------------------
  102. //    • Constructors/Destructors
  103. //
  104. private:
  105.     FW_CInkRep();
  106.     FW_CInkRep(const FW_CInk& ink);
  107.     FW_CInkRep(const FW_CColor& foreColor, const FW_CColor& backColor, FW_TransferMode transferMode);
  108.     virtual ~FW_CInkRep();
  109.  
  110. //------------------------------------------------------------------------------
  111. //    • Public but for internal use only
  112. //
  113. public:
  114.     void        SelectInGC(FW_CGraphicContext* gc, FW_ShapeCategory shapeCategory);
  115.  
  116. //------------------------------------------------------------------------------
  117. //    • Data Members
  118. //
  119. private:
  120.     FW_CColor        fForeColor;
  121.     FW_CColor        fBackColor;
  122.     FW_TransferMode fTransferMode;
  123. };
  124.  
  125.  
  126. #endif
  127.